<template>
	<view class="Mes-Box">
		<view class="header">
			<view @click="heaIndex=i" :class="i==heaIndex?'active':''" v-for="(v,i) in heaTitle" :key="i">{{v}}</view>
		</view>
	
		<view class="section">
			<template v-if="heaIndex==1">
				<view class="tile-box">
						<uni-row v-for="(v,i) in data.list" :key="i">
							<uni-col :span="4" class="imgs">
								<image class="message-img" :src="v.img" alt=""></image> 
							</uni-col>
							<uni-col :span="20">
								<view class="title">
									{{v.title}}
								</view>
								<view class="text">
									{{v.text}}
								</view>
							</uni-col>
						</uni-row>
				</view>
				<div class="Mes-info">
					<uni-row >
						<uni-col :span="4" class="imgs">
							<image src="/static/message/message.jpg" alt=""></image> 
						</uni-col>
						<uni-col  :span="20">
							<view class="title">
								<text>互动消息</text>
								<text class="time">08:41</text>
							</view>
							<view class="text">
								早安~请查收今日份美好一刻
							</view>
						</uni-col>
					</uni-row>
				</div>
			</template>
			<template v-else>
				
			</template>
		</view>
	</view>
</template>

<script setup>
import { ref, onMounted,reactive } from 'vue'
let heaTitle=reactive(['动态','消息'])
let heaIndex=ref(1)
let data=reactive({list:[{
		"img":"/static/message/inform.jpg",
		"path":"/pages/message/info",
		"title":"订单通知",
		"text":"出票状态、预定状态提醒"
	},{
		"img":"/static/message/voice.jpg",
		"path":"/pages/message/voice",
		"title":"出行管家",
		"text":"航班变更等行程提醒"
	},{
		"img":"/static/message/packet.jpg",
		"path":"/pages/message/packet",
		"title":"福利助手",
		"text":"红包、优惠卷、里程过期提醒等"
	}]})


</script>

<style lang="scss">
.Mes-Box{
	.header{
		height: 50px;
		background: white;
		display: flex;
		justify-content: center;
		align-items: center;
		view{
			margin: 0 10px;
			height: 25px;
		}
		.active{
			font-weight: bold;
			border-bottom: solid 2px orange;
		}
	}
	
	.tile-box{
		background: white;
		.uni-row {
			height: 90px;
			width: 100%;
			display: flex;
			background: white;
			
			border-bottom: solid 1px #eeeeee;
			.imgs{
				text-align: center;
				.message-img{
					width: 24upx;
					height: 24upx;
				}
			}
			.uni-col{
				.title{
					color: #815634;
					margin-top: 10px;
					margin-bottom: 5px;
					font-size: 20px;
				}
				.text{
					height: 20px;
					line-height: 20px;
					color: #5c6063;
				}
				
				image{
					width: 80upx;
					height: 80upx;
					text-align: center;
				}
			}
			
		}
	}

	.Mes-info{
		// margin-top: 15px;
		background: white;
		.uni-row {
			height: 90px;
			width: 100%;
			display: flex;
			background: white;
			
			border-bottom: solid 1px #dedede;
			.imgs{
				text-align: center;
				
			}
			.uni-col{
				
				.title{
					color: #815634;
					margin-top: 10px;
					margin-bottom: 5px;
					font-size: 20px;
					display: flex;
					
					justify-content: space-between;
					.time{
						color: #c4c4c4;
						margin-right: 10px;
						font-size: 14px;
					}
				}
				.text{
					height: 20px;
					line-height: 20px;
					color: #5c6063;
				}
				
				image{
					width: 80upx;
					height: 80upx;
					text-align: center;
				}
			}
			
		}
	}
}
</style>
